package com.ruibang.glass.purchase.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruibang.glass.common.domain.camunda.BpmProcessInstanceCreate;
import com.ruibang.glass.purchase.domain.req.PurchaseApplicationReq;
import com.ruibang.glass.purchase.domain.resp.FrameItemData;
import com.ruibang.glass.purchase.domain.resp.OrderItemData;
import com.ruibang.glass.purchase.domain.resp.RequestItemImportData;
import com.ruibang.glass.purchase.dto.GPurchasePurchaseApplicationListDTO;
import com.ruibang.glass.purchase.entity.PurchaseApplicationList;
import com.ruibang.glass.purchase.entity.PurchaseApprovalList;
import com.ruibang.glass.purchase.entity.PurchaseSpecialApplicationList;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 采购申请列表 服务类
 * </p>
 *
 * @author mameng
 * @since 2024-03-26
 */
public interface PurchaseApplicationService extends IService<PurchaseApplicationList> {
    /**
     * 采购申请列表 分页
     * @param deviceAllPageRea
     * @return
     */
    IPage<PurchaseApplicationList> getPage(PurchaseApplicationReq deviceAllPageRea);

    IPage<PurchaseSpecialApplicationList> specialList(PurchaseApplicationReq deviceAllPageRea);

    String getSequenceNumber();

    /**
     * 新增
     * @param gPurchasePurchaseApplicationList
     */
    void addGPurchasePurchaseApplicationList (PurchaseApplicationList gPurchasePurchaseApplicationList);

    /***
     * 审批
     * @param instanceCreate
     */
    void approveProcess(BpmProcessInstanceCreate instanceCreate);
    /**
     * 采购申请列表修改
     * @param gPurchasePurchaseApplicationList
     */
    void updateGPurchasePurchaseApplicationList(PurchaseApplicationList gPurchasePurchaseApplicationList);
    /**
     * 拆分子单
     * @param purchaseApprovalList
     */
    void addApprove(PurchaseApprovalList purchaseApprovalList);
    /**
     * 详情
     * @param id
     */
    PurchaseApplicationList getGPurchasePurchaseApplicationListById(String id);
    /**
     * 采购申请列表
     * @param
     */
    List<GPurchasePurchaseApplicationListDTO> getGPurchasePurchaseApplicationListDTOList();


    PurchaseApplicationList getByNumber(String number);

    Map<String,List<RequestItemImportData>> importItemData(MultipartFile file);

    void getFileTemplate(HttpServletResponse response);

    void exportItemData(List<RequestItemImportData> requestItemImportData,HttpServletResponse response);

    void exportFrameItemData(List<FrameItemData> frameItemData, HttpServletResponse response);

    void exportOrderItemData(List<OrderItemData> orderItemData, HttpServletResponse response);
}
